#!/bin/bash

alsactl init jetsonxaviernxa
echo 0 | sudo tee /sys/kernel/debug/tracing/trace
echo 0 | sudo tee /sys/kernel/debug/tracing/events/enable
echo 1 | sudo tee /sys/kernel/debug/tracing/tracing_on
echo 1 | sudo tee /sys/kernel/debug/tracing/events/asoc/snd_soc_dapm_path/enable
echo 1 | sudo tee /sys/kernel/debug/tracing/events/asoc/snd_soc_dapm_widget_power/enable
amixer -c jetsonxaviernxa cset name="ADMAIF1 Mux" I2S3
amixer -c jetsonxaviernxa cset name="I2S3 Mux" "ADMAIF1"
amixer -c jetsonxaviernxa sget "ADMAIF1 Mux"
amixer -c jetsonxaviernxa cget name="ADMAIF1 Mux"

#Codec Mixer Controls
amixer -c jetsonxaviernxa cset name="x Headphone Playback Volume" "0x1e"
amixer -c jetsonxaviernxa cset name="x Stereo DAC MIXR DAC R1 Switch" "on"
amixer -c jetsonxaviernxa cset name="x Stereo DAC MIXL DAC L1 Switch" "on"
amixer -c jetsonxaviernxa cset name="x HPO R Playback Switch" "on"
amixer -c jetsonxaviernxa cset name="x HPO L Playback Switch" "on"

#aplay -D plughw:CARD=tegrasndt210ref,DEV=0 1K.wav
aplay -D plughw:CARD=jetsonxaviernxa,DEV=0 song-youth.wav

#sudo cat /sys/kernel/debug/tracing/trace
